import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysToolDictRoot = (params) => {
  params.head.transCode = 'querySysToolDictRoot';
  return request({
    url: '/tool/sysToolDictRoot/querySysToolDictRoot',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysToolDictRootListPage = (params) => {
  params.head.transCode = 'querySysToolDictRootListPage';
  return request({
    url: '/tool/sysToolDictRoot/querySysToolDictRootListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysToolDictRoot = (params) => {
  params.head.transCode = 'saveSysToolDictRoot';
  return request({
    url: '/tool/sysToolDictRoot/saveSysToolDictRoot',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysToolDictRootList = (params) => {
  params.head.transCode = 'saveSysToolDictRootList';
  return request({
    url: '/tool/sysToolDictRoot/saveSysToolDictRootList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysToolDictRoot = (params) => {
  params.head.transCode = 'saveOrUpdateSysToolDictRoot';
  return request({
    url: '/tool/sysToolDictRoot/saveOrUpdateSysToolDictRoot',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysToolDictRootList = (params) => {
  params.head.transCode = 'saveOrUpdateSysToolDictRootList';
  return request({
    url: '/tool/sysToolDictRoot/saveOrUpdateSysToolDictRootList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysToolDictRoot = (params) => {
  params.head.transCode = 'updateSysToolDictRoot';
  return request({
    url: '/tool/sysToolDictRoot/updateSysToolDictRoot',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysToolDictRoot = (params) => {
  params.head.transCode = 'deleteSysToolDictRoot';
  return request({
    url: '/tool/sysToolDictRoot/deleteSysToolDictRoot',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysToolDictRootList = (params) => {
  params.head.transCode = 'deleteSysToolDictRootList';
  return request({
    url: '/tool/sysToolDictRoot/deleteSysToolDictRootList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysToolDictRootExcel = (params) => {
  downloadExcel({
    url: '/tool/sysToolDictRoot/excelDownload/exportSysToolDictRootExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
